classdef experiment < handle
    %UNTITLED Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
                system_=[]; 
    end
    
    methods
        function plot_instances(obj,instances)
            u=UtilityLib();
            color_num =1; 
             color=...
                    [1 0 1 % magenta
                    0 1 1  %cyan 
                    0 1 1 %  cyan 
                    0 1 1 %  cyan 
                    1 0 0 %red
                    1 0 0 %red
                    1 0 0 %red
                    0 1 0 %green
                    0 1 0 %green
                    0 0 1 %blue
                    0 0 1]; %blue

            lnstyle = {'-.','-.','--','-','-.','--','-','--','-','--','-'};
            for k= 1 : size(instances,2)
             %   [k/11, k/11, (11-k)/11],
%                 plot(instances(:,k), strcat(u.lnstyle{mod(color_num,4)+1},u.color{mod(color_num,7)+1}),...
%                     'LineWidth',2,...
%                     'MarkerSize',10);       %  'MarkerEdgeColor','k',...          %    'MarkerFaceColor','g',...
                plot(instances(:,k), lnstyle{k},...
                    'Color',color(k,:),...
                    'LineWidth',2,...
                    'MarkerSize',10);       %  'MarkerEdgeColor','k',...          %    'MarkerFaceColor','g',...
                hold on;
                color_num = color_num+1;
            end
            axis([0 size(instances,1) 0 max(max(instances))+2]) ;
            legend(prices_amz().get_api_names');
        end
        
        function plot_all(obj,workload,rt_target)
            subplot(3,1,1); plot(workload);
            subplot(3,1,2); plot(obj.system_.past_util());
            line([0 size(workload,1)],[rt_target rt_target],'Marker','.','LineStyle','--','Color',[.8 .8 .8])
            % subplot(3,1,3); plot( system.past_future_inst()  );
            subplot(3,1,3); obj.plot_instances(obj.system_.past_inst());
        end
        
    end
    
end

